package Operation;

import book.BookList;

import java.util.Scanner;

public class Find implements IOperation{
    public void work(BookList bookList) {
        System.out.println("查阅");
        System.out.println("输入你要查找的图书名");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getNumberBooksExisted(); i++) {
            if(name.equals(bookList.getBook(i).getName()))
                System.out.println(bookList.getBook(i));
        }
    }
}
